From 8f28bee3039fe6a36839b9eaa3a326755b5c37b5 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 19 Nov 2010 13:23:34 +0000 Subject: [PATCH] iommu: adjust section annotations in pass-through code Most importantly, anything Dom0 construction related can be __init. Signed-off-by: Jan Beulich --- xen/drivers/passthrough/amd/pci_amd_iommu.c | 4 ++-- xen/drivers/passthrough/iommu.c | 4 ++-- xen/drivers/passthrough/vtd/ia64/vtd.c | 6 +++--- xen/drivers/passthrough/vtd/iommu.c | 6 +++--- xen/drivers/passthrough/vtd/x86/ats.c | 6 +++--- xen/drivers/passthrough/vtd/x86/vtd.c | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c index dd5bc774b1..2140c17ecc 100644 --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c @@ -117,7 +117,7 @@ static void amd_iommu_setup_domain_device( spin_unlock_irqrestore(&iommu->lock, flags); } -static void amd_iommu_setup_dom0_devices(struct domain *d) +static void __init amd_iommu_setup_dom0_devices(struct domain *d) { struct amd_iommu *iommu; struct pci_dev *pdev; @@ -232,7 +232,7 @@ static int amd_iommu_domain_init(struct domain *d) return 0; } -static void amd_iommu_dom0_init(struct domain *d) +static void __init amd_iommu_dom0_init(struct domain *d) { unsigned long i; diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c index c9c1835005..57f0daa376 100644 --- a/xen/drivers/passthrough/iommu.c +++ b/xen/drivers/passthrough/iommu.c @@ -40,7 +40,7 @@ static int iommu_populate_page_table(struct domain *d); custom_param("iommu", parse_iommu_param); bool_t __read_mostly iommu_enabled = 1; bool_t __read_mostly force_iommu; -bool_t __read_mostly iommu_dom0_strict; +bool_t __initdata iommu_dom0_strict; bool_t __read_mostly iommu_verbose; bool_t __read_mostly iommu_workaround_bios_bug; bool_t __read_mostly iommu_passthrough; @@ -102,7 +102,7 @@ int iommu_domain_init(struct domain *d) return hd->platform_ops->init(d); } -void iommu_dom0_init(struct domain *d) +void __init iommu_dom0_init(struct domain *d) { struct hvm_iommu *hd = domain_hvm_iommu(d); diff --git a/xen/drivers/passthrough/vtd/ia64/vtd.c b/xen/drivers/passthrough/vtd/ia64/vtd.c index 5ff7623739..6f64f57676 100644 --- a/xen/drivers/passthrough/vtd/ia64/vtd.c +++ b/xen/drivers/passthrough/vtd/ia64/vtd.c @@ -92,8 +92,8 @@ void hvm_dpci_isairq_eoi(struct domain *d, unsigned int isairq) /* dummy */ } -static int do_dom0_iommu_mapping(unsigned long start, unsigned long end, - void *arg) +static int __init do_dom0_iommu_mapping(unsigned long start, + unsigned long end, void *arg) { unsigned long tmp, pfn, j, page_addr = start; struct domain *d = (struct domain *)arg; @@ -120,7 +120,7 @@ static int do_dom0_iommu_mapping(unsigned long start, unsigned long end, return 0; } -void iommu_set_dom0_mapping(struct domain *d) +void __init iommu_set_dom0_mapping(struct domain *d) { if (dom0) BUG_ON(d != dom0); diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index 4d66a3fcf6..47b6f68075 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -1231,7 +1231,7 @@ static int intel_iommu_domain_init(struct domain *d) return 0; } -static void intel_iommu_dom0_init(struct domain *d) +static void __init intel_iommu_dom0_init(struct domain *d) { struct acpi_drhd_unit *drhd; @@ -1826,7 +1826,7 @@ static int intel_iommu_remove_device(struct pci_dev *pdev) return domain_context_unmap(pdev->domain, pdev->bus, pdev->devfn); } -static void setup_dom0_devices(struct domain *d) +static void __init setup_dom0_devices(struct domain *d) { struct pci_dev *pdev; int bus, devfn; @@ -1961,7 +1961,7 @@ static int init_vtd_hw(void) return 0; } -static void setup_dom0_rmrr(struct domain *d) +static void __init setup_dom0_rmrr(struct domain *d) { struct acpi_rmrr_unit *rmrr; u16 bdf; diff --git a/xen/drivers/passthrough/vtd/x86/ats.c b/xen/drivers/passthrough/vtd/x86/ats.c index e56c9d5ad4..cf564444cd 100644 --- a/xen/drivers/passthrough/vtd/x86/ats.c +++ b/xen/drivers/passthrough/vtd/x86/ats.c @@ -28,7 +28,7 @@ #include "../vtd.h" #include "../extern.h" -LIST_HEAD(ats_dev_drhd_units); +static LIST_HEAD(ats_dev_drhd_units); #define ATS_REG_CAP 4 #define ATS_REG_CTL 6 @@ -47,9 +47,9 @@ static LIST_HEAD(ats_devices); static void parse_ats_param(char *s); custom_param("ats", parse_ats_param); -int ats_enabled = 1; +int __read_mostly ats_enabled = 1; -static void parse_ats_param(char *s) +static void __init parse_ats_param(char *s) { char *ss; diff --git a/xen/drivers/passthrough/vtd/x86/vtd.c b/xen/drivers/passthrough/vtd/x86/vtd.c index 72323c9002..c561924f84 100644 --- a/xen/drivers/passthrough/vtd/x86/vtd.c +++ b/xen/drivers/passthrough/vtd/x86/vtd.c @@ -34,7 +34,7 @@ * iommu_inclusive_mapping: when set, all memory below 4GB is included in dom0 * 1:1 iommu mappings except xen and unusable regions. */ -static int iommu_inclusive_mapping = 1; +static int __read_mostly iommu_inclusive_mapping = 1; boolean_param("iommu_inclusive_mapping", iommu_inclusive_mapping); void *map_vtd_domain_page(u64 maddr) @@ -127,7 +127,7 @@ void hvm_dpci_isairq_eoi(struct domain *d, unsigned int isairq) spin_unlock(&d->event_lock); } -void iommu_set_dom0_mapping(struct domain *d) +void __init iommu_set_dom0_mapping(struct domain *d) { u64 i, j, tmp, max_pfn; extern int xen_in_range(unsigned long mfn); -- 2.30.2